import type { App } from 'vue';
import { createRouter, createWebHashHistory } from 'vue-router'
import homeRouter from "./modules/home";

const routes = [
  {
    path: "/",
    component: () => import('../layout/login/LoginLayout.vue'),
    redirect: "/download",
    children: [
      {
        path: "download",
        name: "download",
        component: () => import('../views/DownloadingScreen.vue'),
      },

      {
        path: "login",
        name: "login",
        component: () => import('../views/Login.vue'),
      },
      // {
      //   path: "new-wallet",
      //   name: "new wallet",
      //   component: NewWallet
      // },
      // {
      //   path: "accept-terms-of-service",
      //   name: "accept terms of service",
      //   component: TermsOfService
      // },
      {
        path: "loading",
        name: "loading",
        component: () => import('../views/LoadingScreen.vue'),
      }
    ]
  },
  homeRouter,
  {
    path: '/features',
    name: 'Features',
    component: () => import('../components/Features.vue'),
  },
]

const router = createRouter({
  history: createWebHashHistory(),
  routes,
})
// config router
export function setupRouter(app: App<Element>) {
  app.use(router);
}
